from django.db import models
from django.contrib.auth.models import AbstractUser

# Create your models here.


class myUser(AbstractUser):
    # 除账号/姓名,密码和邮箱以外
    idcard = models.CharField(verbose_name="员工编号", blank=True, max_length=8)
    company = models.CharField(verbose_name="公司", blank=True, max_length=20)
    department = models.CharField(verbose_name="部门", blank=True, max_length=20)
    workshop = models.CharField(verbose_name="车间/科室", blank=True, max_length=20)
    position = models.CharField(verbose_name="岗位名称", blank=True, max_length=20)
    is_see = models.BooleanField(verbose_name="查看", default=True)
    is_edit = models.BooleanField(verbose_name="编辑", default=False)
    is_delete = models.BooleanField(verbose_name="删除", default=False)
    is_auditor = models.BooleanField(verbose_name="审批", default=False)
    is_area = models.CharField(verbose_name="负责区域(PFMEA权限)", max_length=10, blank=True)
    area = models.CharField(verbose_name="所属区域", max_length=20, blank=True)
    role = models.CharField(verbose_name="角色", max_length=20, blank=True)
    base = models.CharField(verbose_name="所属基地", blank=True, max_length=20)

    def __str__(self):
        return self.username
